home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11539 < prev    next >
Encoding:
Text File  |  1996-08-05  |  893 b   |  25 lines

  1. Path: news3.digex.net!usenet
  2. From: Tom Burket <burket@cpcug.org>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Need Help Creating DLL with Return Arguments
  5. Date: Thu, 14 Mar 1996 19:48:44 -0500
  6. Organization: Capital PC User Group
  7. Message-ID: <3148BE6C.2E5E@cpcug.org>
  8. References: <4i7krl$g9i@news2.realtime.net>
  9. NNTP-Posting-Host: cpcug.org
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. Isn't the top level routine wrong? You should either return the pointer 
  16. to the environment variable in GetEnvironmentVar or copy the data from 
  17. the returned pointer into the rtn_value pointer, as in 
  18.    char* p;
  19.    p = getenv(envar);
  20.    if (p != NULL) strcpy(rtn_value,p);
  21.  
  22. To me it looks like the wrong level of indirection and you shouldn't 
  23. assume the environment variable is set anyway. What if it isn't? You 
  24. will fail.
  25.